package com.ask.threadMethod;

public class MyRunnable implements Runnable {
    @Override
    public void run() {

        for (int i = 0; i < 50; i++) {
            System.out.println(Thread.currentThread().getName() + i);
        }
    }

    public static void main(String[] args) {
        MyRunnable mr = new MyRunnable();
        Thread t1 = new Thread(mr, "飞机线程");
        Thread t2 = new Thread(mr, "大炮线程");

        t1.setDaemon(true);
        t1.start();
        t2.start();


    }
}
